import { ProgressBarCustomBgNBar } from "../../../../component/progressBar/ProgressBarCustomBgNBar";
import { SAttribute } from "../../../../../Message/Public/SAttribute";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
type int = number;
//class Lv88ProgressBar
    
    export  class Lv88ProgressBar extends ProgressBarCustomBgNBar
    {
        constructor(arg1: string, arg2: string, arg3: number, arg4: number, arg5: int=-1)
        {
            super(arg1, arg2, arg3, arg4, arg5);
            return;
        }

        public get curFireNum(): int
        {
            return this._curFireNum;
        }

        public set curFireNum(arg1: int)
        {
            this._curFireNum = arg1;
            if (this._curFireNum > this.fireMaxNum) 
            {
                this._curFireNum = this.fireMaxNum;
            }
            this.updateFireShow();
            return;
        }

        public updateFire(arg1: SAttribute): void
        {
            var loc1=int(arg1.valueStr);
            var loc2=arg1.value;
            setValue(loc2);
            this.curFireNum = loc1;
            return;
        }

        /* internal  */updateFireShow(): void
        {
            var loc2=null;
            var loc1=0;
            while (loc1 < this.fireMaxNum) 
            {
                loc2 = this._fires[loc1];
                if (loc1 < this._curFireNum) 
                {
                    loc2.filters = [];
                }
                else 
                {
                    loc2.filters = [FilterConst.colorFilter];
                }
                ++loc1;
            }
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            var loc1=null;
            super.createDisposedChildrenImpl();
            this._fires = [];
            var loc2=0;
            while (loc2 < this.fireMaxNum) 
            {
                loc1 = ObjCreate.createBitmap(ImagesConst.LV88_FireEnable, this.fireStartX + loc2 * this.fireDistance, this.fireStartY, this);
                this._fires.push(loc1);
                ++loc2;
            }
            this.updateFireShow();
            return;
        }

        /* internal */ /* const */fireStartX: int=245;

        /* internal */ /* const */fireStartY: int=5;

        /* internal */ /* const */fireDistance: int=27;

        /* internal */ /* const */fireMaxNum: int=5;

        /* internal */ /* var */_fires: Array<any>;

        /* internal */ /* var */_curFireNum: int=0;
    }
